using UnityEngine;

namespace AndroidCaller
{
	public class NativeCall : MonoBehaviour
	{
		public static void Call(string name)
		{
			using (AndroidJavaClass androidJavaClass = new AndroidJavaClass("com.unity3d.player.UnityPlayer"))
			{
				using (AndroidJavaObject androidJavaObject = androidJavaClass.GetStatic<AndroidJavaObject>("currentActivity"))
				{
					androidJavaObject.CallStatic(name);
				}
			}
		}

		public static void CallArg(string name, string arg)
		{
			using (AndroidJavaClass androidJavaClass = new AndroidJavaClass("com.unity3d.player.UnityPlayer"))
			{
				using (AndroidJavaObject androidJavaObject = androidJavaClass.GetStatic<AndroidJavaObject>("currentActivity"))
				{
					androidJavaObject.CallStatic(name, arg);
				}
			}
		}
	}
}
